<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>3233：[Ahoi2013]找硬币</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Ahoi2013]找硬币</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Ahoi2013]找硬币</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Ahoi2013]找硬币                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：64MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div>
<div style="margin: 5pt 44.9pt 0pt 18pt; line-height: 19.5pt" align="left"><span style="font-size: medium"><span style="color: black">小蛇是金融部部长。最近她决定制造一系列新的货币。假设她要制造的货币</span><span style="color: black">的面值为</span><span style="color: black">x1,x2,x3&hellip; </span><span style="color: black">那么</span><span style="color: black">x1</span><span style="color: black">必须为</span><span style="color: black">1</span><span style="color: black">，</span><span style="color: black">xb</span><span style="color: black">必须为</span><span style="color: black">xa</span><span style="color: black">的正整数倍（</span><span style="color: black">b&gt;a</span><span style="color: black">）。例如</span><span style="color: black"> 1</span><span style="color: black">，</span><span style="color: black">5</span><span style="color: black">，</span><span style="color: black">125</span><span style="color: black">，</span><span style="color: black">250</span><span style="color: black">就是一组合法的硬币序列，而</span><span style="color: black">1</span><span style="color: black">，</span><span style="color: black">5</span><span style="color: black">，</span><span style="color: black">100</span><span style="color: black">，</span><span style="color: black">125</span><span style="color: black">就不是。</span><span style="color: black">不知从哪一天开始，可爱的蛇爱上了一种萌物</span><span style="color: black">&mdash;&mdash;</span><span style="color: black">兔纸！从此，小蛇便走上</span><span style="color: black">了遇上兔纸娃娃就买的不归路。某天，小蛇看到了</span><span style="color: black">N</span><span style="color: black">只可爱的兔纸，假设这</span><span style="color: black">N </span><span style="color: black">只兔纸的价钱分别是</span><span style="color: black">a1,a2&hellip;aN</span><span style="color: black">。现在小蛇想知道，在哪一组合法的硬币序列下，</span><span style="color: black">买这</span><span style="color: black">N</span><span style="color: black">只兔纸所需要的硬币数最少。买兔纸时不能找零。</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 6pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
</div></p><hr/><h3>输入格式</h3><p><div style="margin: 6pt -3pt 0pt 18pt; line-height: 12pt" align="left"><span style="font-size: medium"><span style="color: black">第一行，一个整数</span><span style="color: black">N</span><span style="color: black">，表示兔纸的个数</span></span></div>
<div style="margin: 5pt -3pt 0pt 18pt; line-height: 12pt" align="left"><span style="font-size: medium"><span style="color: black">第二行，</span><span style="color: black">N</span><span style="color: black">个用空格隔开的整数，分别为</span><span style="color: black">N</span><span style="color: black">只兔纸的价钱</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 6pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div></p><hr/><h3>输出格式</h3><p><p><span style="font-size: medium"><span style="color: black">一行，一个整数，表示最少付的钱币数。</span></span></p>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 10pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div>
<div style="margin: 0cm -1.1pt 0pt 0cm; line-height: 6pt" align="left"><span style="font-size: medium"><span style="color: black">&nbsp;</span></span></div></p><hr/><h3>样例输入</h3><pre>2 
25 102 
 
 
 
</pre><hr/><h3>样例输出</h3><pre>4 
 
 </pre><hr/><h3>提示</h3><p><p><span style="font-size: medium"><br />
&nbsp;<br />
样例解释：共有两只兔纸，价钱分别为25和102。现在小蛇构造1，25，100这样一组硬币序列，那么付第一只兔纸只需要一个面值为25的硬币，第二只兔纸需要一个面值为100的硬币和两个面值为1的硬币，总共两只兔纸需要付4个硬币。这也是所有方案中最少所需要付的硬币数。<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;</span></p>
<p><span style="font-size: medium">&nbsp;&nbsp; 1&lt;=N&lt;=50, 1&lt;=ai&lt;=100,000 </span></p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=3233" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=3233" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>